package com.mimi.util;

import java.util.Random;

/**
 * @Author:徐向
 * @Description:
 * @Date: Created in 13:40 2017/10/9
 */
public class KeyUtil {
    /**
     * 生成唯一主键
     * 格式:时间+随机数
     * @return
     */
    public static synchronized String getUniqueKey() {
        Random random = new Random();

        Integer number = random.nextInt(900000)+10;
        return System.currentTimeMillis() + String.valueOf(number);
    }

}
